package com.winsdom.mapper;

import com.winsdom.dto.threeTables.ThreeTablesDto;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.winsdom.domain.vo.FinishedThreeTableVO;
import com.winsdom.domain.vo.UnfinishedThreeTableVO;
import com.winsdom.entity.ThreeTables;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.winsdom.vo.threeTables.ThreeTablesVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 三表表 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2025-05-12
 */
@Mapper
public interface ThreeTablesMapper extends BaseMapper<ThreeTables> {

    Page<UnfinishedThreeTableVO> getUnfinishedThreeTables(Page<UnfinishedThreeTableVO> page,
                                                          @Param("resourceId") Long resourceId,
                                                          @Param("number")String number,
                                                          @Param("type")Integer type);
    Page<UnfinishedThreeTableVO> getUnfinishedThreeTables2(Page<UnfinishedThreeTableVO> page,
                                                           @Param("idList") List<Long> idList,
                                                           @Param("number")String number,
                                                           @Param("type")Integer type);

    Page<FinishedThreeTableVO> getFinishedThreeTables(Page<FinishedThreeTableVO> page,
                                                      @Param("resourceId") Long resourceId,
                                                      @Param("number")String number,
                                                      @Param("type")Integer type);

    Page<FinishedThreeTableVO> getFinishedThreeTables2(Page<FinishedThreeTableVO> page,
                                                      @Param("idList") List<Long> idList,
                                                      @Param("number")String number,
                                                      @Param("type")Integer type);
    List<FinishedThreeTableVO> getFinishedThreeTables2(@Param("idList") List<Long> idList,
                                                       @Param("number")String number,
                                                       @Param("type")Integer type);

    List<com.winsdom.vo.resource.ThreeTablesVo> getYThreeTables(@Param("categoryId") Long categoryId);

    List<ThreeTablesVo> getListForParams(ThreeTablesDto threeTablesDto);

    @Select("SELECT id from three_tables WHERE category_id = #{resourceId}")
    List<Long> getTableIdByCategoryId(Long resourceId);

}
